From 533ba0bcefdd43ddca1e7889fdba5b19b46e19df Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Thu, 20 Feb 2020 07:48:28 -0700 Subject: [PATCH] update format specific handling. (#502) * update format specific handling. Format specific allocate, copy, destroy functions use new/delete for underlying data management. Use brace intitializers for underlying data. Previous xmalloc/xcalloc and xfree were used. Format specific copy functions use copy constructor of underlying data. Format specific copy functions have a const source. Format specific functions use static_cast instead of c-style casts. This helps avoid casting away const accidentally. When possible, assign the result of fs_chain_find to a const pointer. Eliminate corruption of global lists by AN1 writer which was modifying format specific data. This also simplifies memomry management and fixes a double delete. Fix const correctness issues with an1 symbol lookup. Correct an1 symbol lookup to avoid dependency on structure padding. Catch make-an1sym.pl with an1sym.h. * use reinterpret_cast w/ fs_chain_add fs_chain_find ... instead of c-style casts. * make format_specifc_data a base class and the various flavors derived classes. * use a QList for format_specific_data chains. * split format specific defines ... use reinterpret_cast to downcast format_specific_data. dynamic_cast is noticeably slower. * add new formspec.h file. * create FormatSpecificDataList class. rename format specific related items. * safety check for formspec nullptr function ptrs. * replace format specific function pointers with pure virtual clone function and dtor. --- CMakeLists.txt | 1 + GPSBabel.pro | 1 + Makefile.in | 701 ++++++++++++++++++++++++---------------------- an1.cc | 373 +++++++++++------------- an1sym.h | 15 +- bend.cc | 2 +- defs.h | 33 +-- destinator.cc | 2 +- formspec.cc | 48 ++-- formspec.h | 60 ++++ g7towin.cc | 10 +- garmin_fs.cc | 89 ++---- garmin_fs.h | 27 +- garmin_gpi.cc | 2 +- garmin_txt.cc | 10 +- gdb.cc | 4 +- gpx.cc | 19 +- gpx.h | 4 +- html.cc | 113 ++++---- interpolate.cc | 2 +- kml.cc | 3 +- lowranceusr.cc | 95 +++---- make-an1sym.pl | 49 ++-- ozi.cc | 43 ++- random.cc | 2 +- route.cc | 7 +- src/core/xmltag.h | 16 +- text.cc | 103 ++++--- unicsv.cc | 2 +- waypt.cc | 15 +- xcsv.cc | 2 +- xmltag.cc | 32 +-- 32 files changed, 910 insertions(+), 975 deletions(-) create mode 100644 formspec.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ab759a46..356c20f44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,7 @@ set(HEADERS filter.h filter_vecs.h format.h + formspec.h garmin_device_xml.h garmin_fs.h garmin_gpi.h diff --git a/GPSBabel.pro b/GPSBabel.pro index 1efcacf3b..9ea05dd27 100644 --- a/GPSBabel.pro +++ b/GPSBabel.pro @@ -99,6 +99,7 @@ HEADERS = \ filter.h \ filter_vecs.h \ format.h \ + formspec.h \ garmin_device_xml.h \ garmin_fs.h \ garmin_gpi.h \ diff --git a/Makefile.in b/Makefile.in index 9eaeba83f..4981783b5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -426,279 +426,295 @@ mac/libusb/libusb-1.0.a: cd mac/libusb; $(QMAKE) @abs_srcdir@/mac/libusb/libusb.pro && $(MAKE) # Machine generated from here down. -alan.o: alan.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -an1.o: an1.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h an1sym.h -arcdist.o: arcdist.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +alan.o: alan.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +an1.o: an1.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + an1sym.h +arcdist.o: arcdist.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ arcdist.h filter.h grtcirc.h src/core/logging.h -bcr.o: bcr.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h csv_util.h \ - garmin_tables.h -bend.o: bend.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h bend.h \ - filter.h grtcirc.h +bcr.o: bcr.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + csv_util.h garmin_tables.h +bend.o: bend.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + bend.h filter.h grtcirc.h brauniger_iq.o: brauniger_iq.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h gbser.h -bushnell.o: bushnell.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +bushnell.o: bushnell.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h bushnell_trl.o: bushnell_trl.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -cet.o: cet.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -cet_util.o: cet_util.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - cet_util.h src/core/logging.h -compegps.o: compegps.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - cet_util.h csv_util.h jeeps/gpsmath.h jeeps/gpsport.h -cst.o: cst.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h -csv_util.o: csv_util.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - csv_util.h src/core/logging.h -delgpl.o: delgpl.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +cet.o: cet.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet.h +cet_util.o: cet_util.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h cet_util.h src/core/logging.h +compegps.o: compegps.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h cet_util.h csv_util.h jeeps/gpsmath.h \ + jeeps/gpsport.h +cst.o: cst.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h +csv_util.o: csv_util.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h csv_util.h src/core/logging.h +delgpl.o: delgpl.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h destinator.o: destinator.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \ jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h \ strptime.h -dg-100.o: dg-100.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +dg-100.o: dg-100.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbser.h -discard.o: discard.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +discard.o: discard.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ discard.h filter.h -dmtlog.o: dmtlog.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +dmtlog.o: dmtlog.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h xmlgeneric.h -duplicate.o: duplicate.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - duplicate.h filter.h -easygps.o: easygps.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +duplicate.o: duplicate.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h duplicate.h filter.h +easygps.o: easygps.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h energympro.o: energympro.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -enigma.o: enigma.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +enigma.o: enigma.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -exif.o: exif.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +exif.o: exif.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h explorist_ini.o: explorist_ini.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h explorist_ini.h + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h explorist_ini.h f90g_track.o: f90g_track.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -fatal.o: fatal.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +fatal.o: fatal.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h filter_vecs.o: filter_vecs.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h filter_vecs.h arcdist.h filter.h bend.h discard.h \ - duplicate.h height.h interpolate.h nukedata.h polygon.h position.h \ - radius.h reverse_route.h smplrout.h sort.h stackfilter.h swapdata.h \ - trackfilter.h transform.h validate.h gbversion.h vecs.h format.h gpx.h \ - src/core/file.h src/core/xmlstreamwriter.h src/core/xmltag.h \ - legacyformat.h -formspec.o: formspec.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -g7towin.o: g7towin.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + duplicate.h height.h heightgrid.h interpolate.h nukedata.h polygon.h \ + position.h radius.h reverse_route.h smplrout.h sort.h stackfilter.h \ + swapdata.h trackfilter.h transform.h validate.h gbversion.h vecs.h \ + format.h ggv_bin.h gpx.h src/core/file.h src/core/xmlstreamwriter.h \ + src/core/xmltag.h legacyformat.h mynav.h xcsv.h garmin_fs.h \ + jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h jeeps/gpsdevice.h \ + jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h \ + jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h \ + jeeps/gpsmem.h jeeps/gpsrqst.h src/core/textstream.h +formspec.o: formspec.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +g7towin.o: g7towin.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h csv_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \ jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h \ garmin_tables.h strptime.h -garmin.o: garmin.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +garmin.o: garmin.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h format.h garmin_device_xml.h garmin_fs.h jeeps/gps.h \ jeeps/../defs.h jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h \ jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \ jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h \ jeeps/gpsrqst.h garmin_tables.h grtcirc.h jeeps/gpsserial.h vecs.h \ - gpx.h src/core/file.h src/core/xmlstreamwriter.h src/core/xmltag.h \ - legacyformat.h + ggv_bin.h gpx.h src/core/file.h src/core/xmlstreamwriter.h \ + src/core/xmltag.h legacyformat.h mynav.h xcsv.h src/core/textstream.h garmin_device_xml.o: garmin_device_xml.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h garmin_device_xml.h xmlgeneric.h + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h garmin_device_xml.h \ + xmlgeneric.h garmin_fit.o: garmin_fit.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h jeeps/gpsmath.h jeeps/gpsport.h -garmin_fs.o: garmin_fs.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - cet_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ - jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ - jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ - jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h garmin_tables.h +garmin_fs.o: garmin_fs.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \ + jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \ + jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ + jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h \ + garmin_tables.h garmin_gpi.o: garmin_gpi.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h garmin_gpi.h cet_util.h garmin_fs.h jeeps/gps.h \ jeeps/../defs.h jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h \ jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \ jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h \ jeeps/gpsrqst.h garmin_tables.o: garmin_tables.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h \ - src/core/logging.h garmin_icon_tables.h + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h garmin_tables.h \ + jeeps/gpsmath.h jeeps/gpsport.h src/core/logging.h \ + garmin_icon_tables.h garmin_txt.o: garmin_txt.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h csv_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \ jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \ jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h \ garmin_tables.h src/core/textstream.h src/core/file.h strptime.h -garmin_xt.o: garmin_xt.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -gbfile.o: gbfile.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +garmin_xt.o: garmin_xt.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +gbfile.o: gbfile.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/logging.h -gbser.o: gbser.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + src/core/logging.h cet.h +gbser.o: gbser.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbser.h gbser_private.h gbser_posix.o: gbser_posix.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h gbser.h gbser_private.h -gdb.o: gdb.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h \ - garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ +gdb.o: gdb.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h garmin_tables.h \ grtcirc.h -geo.o: geo.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/file.h -geojson.o: geojson.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +geo.o: geo.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ src/core/file.h -ggv_bin.o: ggv_bin.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +geojson.o: geojson.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - ggv_bin.h format.h -ggv_log.o: ggv_log.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + src/core/file.h +ggv_bin.o: ggv_bin.cc ggv_bin.h defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h format.h +ggv_log.o: ggv_log.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -ggv_ovl.o: ggv_ovl.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +ggv_ovl.o: ggv_ovl.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -globals.o: globals.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +globals.o: globals.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbversion.h globalsat_sport.o: globalsat_sport.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h gbser.h -glogbook.o: glogbook.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/file.h xmlgeneric.h -gnav_trl.o: gnav_trl.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -googledir.o: googledir.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - xmlgeneric.h -gopal.o: gopal.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h gbser.h +glogbook.o: glogbook.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h src/core/file.h xmlgeneric.h +gnav_trl.o: gnav_trl.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +googledir.o: googledir.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h xmlgeneric.h +gopal.o: gopal.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h csv_util.h grtcirc.h jeeps/gpsmath.h jeeps/gpsport.h \ strptime.h -gpssim.o: gpssim.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +gpssim.o: gpssim.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -gpsutil.o: gpsutil.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +gpsutil.o: gpsutil.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h magellan.h -gpx.o: gpx.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h gpx.h \ - format.h src/core/file.h src/core/xmlstreamwriter.h src/core/xmltag.h \ - garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ - jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ - jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ - jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h garmin_tables.h \ - src/core/logging.h -grtcirc.o: grtcirc.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +gpx.o: gpx.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + gpx.h format.h src/core/file.h src/core/xmlstreamwriter.h \ + src/core/xmltag.h garmin_fs.h jeeps/gps.h jeeps/../defs.h \ + jeeps/gpsport.h jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h \ + jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \ + jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h \ + garmin_tables.h src/core/logging.h +grtcirc.o: grtcirc.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -gtm.o: gtm.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +gtm.o: gtm.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h -gtrnctr.o: gtrnctr.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +gtrnctr.o: gtrnctr.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ xmlgeneric.h -height.o: height.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +height.o: height.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ height.h filter.h heightgrid.h -hiketech.o: hiketech.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/xmlstreamwriter.h xmlgeneric.h -holux.o: holux.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +hiketech.o: hiketech.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h src/core/xmlstreamwriter.h xmlgeneric.h +holux.o: holux.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ holux.h -html.o: html.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +html.o: html.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h src/core/xmltag.h humminbird.o: humminbird.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -igc.o: igc.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h -ignrando.o: ignrando.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +igc.o: igc.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h +ignrando.o: ignrando.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h xmlgeneric.h +igo8.o: igo8.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +ik3d.o: ik3d.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ xmlgeneric.h -igo8.o: igo8.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -ik3d.o: ik3d.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ - xmlgeneric.h -inifile.o: inifile.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +inifile.o: inifile.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ src/core/file.h internal_styles.o: internal_styles.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h interpolate.o: interpolate.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h interpolate.h filter.h grtcirc.h -itracku.o: itracku.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +itracku.o: itracku.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbser.h jeeps/gpsapp.o: jeeps/gpsapp.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/garminusb.h \ jeeps/gpsserial.h jeeps/gpsusbint.h jeeps/gpscom.o: jeeps/gpscom.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsdevice.o: jeeps/gpsdevice.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsserial.h jeeps/gpsdevice_ser.o: jeeps/gpsdevice_ser.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsserial.h jeeps/gpsdevice_usb.o: jeeps/gpsdevice_usb.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/garminusb.h \ jeeps/gpsusbcommon.h jeeps/gpsusbint.h jeeps/gpslibusb.o: jeeps/gpslibusb.cc config.h mac/libusb/libusb.h \ - jeeps/../defs.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h \ + jeeps/../defs.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h \ defs.h session.h src/core/datetime.h src/core/optional.h \ jeeps/garminusb.h jeeps/gpsdevice.h jeeps/gps.h jeeps/gpsport.h \ jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h \ @@ -706,50 +722,50 @@ jeeps/gpslibusb.o: jeeps/gpslibusb.cc config.h mac/libusb/libusb.h \ jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsusbcommon.h \ jeeps/../garmin_device_xml.h jeeps/gpsmath.o: jeeps/gpsmath.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsdatum.h jeeps/gpsmem.o: jeeps/gpsmem.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsprot.o: jeeps/gpsprot.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsread.o: jeeps/gpsread.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsserial.h jeeps/gpsrqst.o: jeeps/gpsrqst.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpssend.o: jeeps/gpssend.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsserial.h jeeps/gpsserial.o: jeeps/gpsserial.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/../gbser.h \ jeeps/gpsserial.h gbser_posix.h jeeps/gpsusbcommon.o: jeeps/gpsusbcommon.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ @@ -757,304 +773,327 @@ jeeps/gpsusbcommon.o: jeeps/gpsusbcommon.cc jeeps/gps.h jeeps/../defs.h \ jeeps/gpsusbcommon.h jeeps/gpsusbread.o: jeeps/gpsusbread.cc jeeps/garminusb.h \ jeeps/gpsdevice.h jeeps/gps.h jeeps/../defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ + zlib/zconf.h formspec.h inifile.h gbfile.h defs.h session.h \ src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h \ jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h \ jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsusbint.h jeeps/gpsusbsend.o: jeeps/gpsusbsend.cc jeeps/gps.h jeeps/../defs.h \ - config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h \ + config.h zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/garminusb.h \ jeeps/gpsusbint.h jeeps/jgpsutil.o: jeeps/jgpsutil.cc jeeps/gps.h jeeps/../defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h defs.h session.h \ - src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h defs.h \ + session.h src/core/datetime.h src/core/optional.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h -jogmap.o: jogmap.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +jogmap.o: jogmap.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h xmlgeneric.h -jtr.o: jtr.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h csv_util.h -kml.o: kml.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h grtcirc.h \ - src/core/file.h src/core/logging.h src/core/xmlstreamwriter.h \ - src/core/xmltag.h units.h xmlgeneric.h -lmx.o: lmx.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +jtr.o: jtr.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + csv_util.h +kml.o: kml.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + grtcirc.h src/core/file.h src/core/logging.h \ + src/core/xmlstreamwriter.h src/core/xmltag.h units.h xmlgeneric.h +lmx.o: lmx.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ xmlgeneric.h -lowranceusr.o: lowranceusr.cc src/core/logging.h defs.h config.h \ - zlib/zlib.h zlib/zconf.h cet.h inifile.h gbfile.h session.h \ - src/core/datetime.h src/core/optional.h -maggeo.o: maggeo.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +lowranceusr.o: lowranceusr.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h src/core/logging.h +maggeo.o: maggeo.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ csv_util.h magellan.h xmlgeneric.h -magproto.o: magproto.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - explorist_ini.h format.h gbser.h magellan.h vecs.h gpx.h \ - src/core/file.h src/core/xmlstreamwriter.h src/core/xmltag.h \ - legacyformat.h -main.o: main.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h \ - csv_util.h filter.h filter_vecs.h arcdist.h bend.h discard.h \ - duplicate.h height.h interpolate.h nukedata.h polygon.h position.h \ - radius.h reverse_route.h smplrout.h sort.h stackfilter.h swapdata.h \ - trackfilter.h transform.h validate.h format.h src/core/file.h \ - src/core/usasciicodec.h vecs.h gpx.h src/core/xmlstreamwriter.h \ - src/core/xmltag.h legacyformat.h -mapasia.o: mapasia.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +magproto.o: magproto.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h explorist_ini.h format.h gbser.h magellan.h vecs.h \ + ggv_bin.h gpx.h src/core/file.h src/core/xmlstreamwriter.h \ + src/core/xmltag.h legacyformat.h mynav.h xcsv.h garmin_fs.h \ + jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h jeeps/gpsdevice.h \ + jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h \ + jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h \ + jeeps/gpsmem.h jeeps/gpsrqst.h src/core/textstream.h +main.o: main.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h csv_util.h filter.h filter_vecs.h arcdist.h bend.h \ + discard.h duplicate.h height.h heightgrid.h interpolate.h nukedata.h \ + polygon.h position.h radius.h reverse_route.h smplrout.h sort.h \ + stackfilter.h swapdata.h trackfilter.h transform.h validate.h format.h \ + src/core/file.h src/core/usasciicodec.h vecs.h ggv_bin.h gpx.h \ + src/core/xmlstreamwriter.h src/core/xmltag.h legacyformat.h mynav.h \ + xcsv.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ + jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ + jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ + jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h src/core/textstream.h +mapasia.o: mapasia.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h mapbar_track.o: mapbar_track.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -mapfactor.o: mapfactor.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/file.h src/core/xmlstreamwriter.h -mapsend.o: mapsend.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +mapfactor.o: mapfactor.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h src/core/file.h src/core/xmlstreamwriter.h +mapsend.o: mapsend.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ mapsend.h magellan.h -mapsource.o: mapsource.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +mapsource.o: mapsource.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h +mkshort.o: mkshort.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h -mkshort.o: mkshort.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + cet.h +mmo.o: mmo.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -mmo.o: mmo.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -mtk_locus.o: mtk_locus.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - gbser.h +mtk_locus.o: mtk_locus.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h gbser.h mtk_logger.o: mtk_logger.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h gbser.h -mynav.o: mynav.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - mynav.h format.h -navicache.o: navicache.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - cet_util.h src/core/file.h -naviguide.o: naviguide.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - csv_util.h jeeps/gpsmath.h jeeps/gpsport.h -navilink.o: navilink.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - gbser.h jeeps/gpsmath.h jeeps/gpsport.h navilink.h -navitel.o: navitel.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +mynav.o: mynav.cc src/core/textstream.h src/core/file.h defs.h config.h \ + zlib/zlib.h zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h mynav.h format.h +navicache.o: navicache.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h cet_util.h src/core/file.h +naviguide.o: naviguide.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h csv_util.h jeeps/gpsmath.h jeeps/gpsport.h +navilink.o: navilink.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h gbser.h jeeps/gpsmath.h jeeps/gpsport.h navilink.h +navitel.o: navitel.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h netstumbler.o: netstumbler.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h cet_util.h csv_util.h -nmea.o: nmea.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h \ - gbser.h jeeps/gpsmath.h jeeps/gpsport.h src/core/logging.h strptime.h -nmn4.o: nmn4.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h \ - csv_util.h -nukedata.o: nukedata.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +nmea.o: nmea.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h gbser.h jeeps/gpsmath.h jeeps/gpsport.h src/core/logging.h \ + strptime.h +nmn4.o: nmn4.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h csv_util.h +nukedata.o: nukedata.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h nukedata.h filter.h +osm.o: osm.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - nukedata.h filter.h -osm.o: osm.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ xmlgeneric.h -ozi.o: ozi.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h csv_util.h \ - jeeps/gpsmath.h jeeps/gpsport.h src/core/textstream.h src/core/file.h -parse.o: parse.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +ozi.o: ozi.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + csv_util.h jeeps/gpsmath.h jeeps/gpsport.h src/core/textstream.h \ + src/core/file.h +parse.o: parse.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h -pcx.o: pcx.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h cet_util.h \ - csv_util.h garmin_tables.h +pcx.o: pcx.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet_util.h csv_util.h garmin_tables.h pocketfms_bc.o: pocketfms_bc.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h pocketfms_fp.o: pocketfms_fp.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h xmlgeneric.h pocketfms_wp.o: pocketfms_wp.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h csv_util.h -polygon.o: polygon.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +polygon.o: polygon.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ polygon.h filter.h -position.o: position.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - grtcirc.h position.h filter.h -psitrex.o: psitrex.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +position.o: position.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h grtcirc.h position.h filter.h +psitrex.o: psitrex.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_tables.h -radius.o: radius.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +radius.o: radius.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ radius.h filter.h grtcirc.h -random.o: random.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +random.o: random.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h -raymarine.o: raymarine.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - csv_util.h +raymarine.o: raymarine.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h csv_util.h reverse_route.o: reverse_route.cc defs.h config.h zlib/zlib.h \ - zlib/zconf.h cet.h inifile.h gbfile.h session.h src/core/datetime.h \ - src/core/optional.h reverse_route.h filter.h -rgbcolors.o: rgbcolors.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -route.o: route.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h reverse_route.h filter.h +rgbcolors.o: rgbcolors.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +route.o: route.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -saroute.o: saroute.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +saroute.o: saroute.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -sbn.o: sbn.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h navilink.h -sbp.o: sbp.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h navilink.h -session.o: session.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +sbn.o: sbn.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + navilink.h +sbp.o: sbp.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + navilink.h +session.o: session.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -shape.o: shape.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +shape.o: shape.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ shapelib/shapefil.h shapelib/dbfopen.o: shapelib/dbfopen.c shapelib/shapefil.h shapelib/safileio.o: shapelib/safileio.c shapelib/shapefil.h shapelib/shpopen.o: shapelib/shpopen.c shapelib/shapefil.h -skyforce.o: skyforce.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -skytraq.o: skytraq.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +skyforce.o: skyforce.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +skytraq.o: skytraq.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbser.h -smplrout.o: smplrout.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - grtcirc.h smplrout.h filter.h -sort.o: sort.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h sort.h \ - filter.h -src/core/textstream.o: src/core/textstream.cc src/core/textstream.h \ - src/core/file.h defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +smplrout.o: smplrout.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h grtcirc.h smplrout.h filter.h +sort.o: sort.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + sort.h filter.h +src/core/textstream.o: src/core/textstream.cc defs.h config.h zlib/zlib.h \ + zlib/zconf.h formspec.h inifile.h gbfile.h session.h \ + src/core/datetime.h src/core/optional.h src/core/textstream.h \ + src/core/file.h src/core/usasciicodec.o: src/core/usasciicodec.cc src/core/usasciicodec.h src/core/xmlstreamwriter.o: src/core/xmlstreamwriter.cc \ src/core/xmlstreamwriter.h stackfilter.o: stackfilter.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h stackfilter.h filter.h -stmsdf.o: stmsdf.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +stmsdf.o: stmsdf.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h csv_util.h grtcirc.h jeeps/gpsmath.h jeeps/gpsport.h \ src/core/logging.h -stmwpp.o: stmwpp.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +stmwpp.o: stmwpp.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ csv_util.h cet_util.h strptime.o: strptime.c config.h strptime.h -subrip.o: subrip.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +subrip.o: subrip.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -swapdata.o: swapdata.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - swapdata.h filter.h -tef_xml.o: tef_xml.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +swapdata.o: swapdata.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h swapdata.h filter.h +tef_xml.o: tef_xml.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ xmlgeneric.h -teletype.o: teletype.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -text.o: text.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +teletype.o: teletype.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h +text.o: text.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h src/core/xmltag.h -tiger.o: tiger.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +tiger.o: tiger.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h csv_util.h -tmpro.o: tmpro.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +tmpro.o: tmpro.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ cet_util.h csv_util.h -tomtom.o: tomtom.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +tomtom.o: tomtom.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -tpg.o: tpg.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +tpg.o: tpg.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h -tpo.o: tpo.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +tpo.o: tpo.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h trackfilter.o: trackfilter.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h trackfilter.h filter.h grtcirc.h -transform.o: transform.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - transform.h filter.h -unicsv.o: unicsv.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +transform.o: transform.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h transform.h filter.h +unicsv.o: unicsv.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ csv_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h garmin_tables.h \ src/core/logging.h src/core/textstream.h src/core/file.h -units.o: units.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +units.o: units.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ units.h -util.o: util.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ - src/core/xmltag.h +util.o: util.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + cet.h src/core/xmltag.h util_crc.o: util_crc.cc -v900.o: v900.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -validate.o: validate.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +v900.o: v900.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +validate.o: validate.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h validate.h filter.h +vcf.o: vcf.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - validate.h filter.h -vcf.o: vcf.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ jeeps/gpsmath.h jeeps/gpsport.h -vecs.o: vecs.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h vecs.h \ - format.h gpx.h src/core/file.h src/core/xmlstreamwriter.h \ - src/core/xmltag.h legacyformat.h gbversion.h src/core/logging.h xcsv.h \ - ggv_bin.h mynav.h -vidaone.o: vidaone.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +vecs.o: vecs.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + vecs.h format.h ggv_bin.h gpx.h src/core/file.h \ + src/core/xmlstreamwriter.h src/core/xmltag.h legacyformat.h mynav.h \ + xcsv.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ + jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ + jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ + jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h src/core/textstream.h \ + gbversion.h src/core/logging.h +vidaone.o: vidaone.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -vitosmt.o: vitosmt.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +vitosmt.o: vitosmt.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ grtcirc.h -vitovtt.o: vitovtt.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +vitovtt.o: vitovtt.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h -vpl.o: vpl.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h -waypt.o: waypt.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +vpl.o: vpl.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h +waypt.o: waypt.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h grtcirc.h \ src/core/logging.h -wbt-200.o: wbt-200.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +wbt-200.o: wbt-200.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ gbser.h grtcirc.h -wfff_xml.o: wfff_xml.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - xmlgeneric.h +wfff_xml.o: wfff_xml.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h xmlgeneric.h wintec_tes.o: wintec_tes.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h -xcsv.o: xcsv.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h csv_util.h \ - garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ +xcsv.o: xcsv.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ + csv_util.h garmin_fs.h jeeps/gps.h jeeps/../defs.h jeeps/gpsport.h \ jeeps/gpsdevice.h jeeps/gpssend.h jeeps/gpsread.h jeeps/gpsutil.h \ jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h jeeps/gpsfmt.h \ jeeps/gpsmath.h jeeps/gpsmem.h jeeps/gpsrqst.h grtcirc.h \ - src/core/file.h src/core/logging.h strptime.h xcsv.h xcsv_tokens.gperf + src/core/logging.h src/core/textstream.h src/core/file.h strptime.h \ + xcsv.h format.h xcsv_tokens.gperf xmlgeneric.o: xmlgeneric.cc defs.h config.h zlib/zlib.h zlib/zconf.h \ - cet.h inifile.h gbfile.h session.h src/core/datetime.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ src/core/optional.h cet_util.h src/core/file.h xmlgeneric.h -xmltag.o: xmltag.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ +xmltag.o: xmltag.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ src/core/xmltag.h -xol.o: xol.cc defs.h config.h zlib/zlib.h zlib/zconf.h cet.h inifile.h \ - gbfile.h session.h src/core/datetime.h src/core/optional.h \ +xol.o: xol.cc defs.h config.h zlib/zlib.h zlib/zconf.h formspec.h \ + inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ garmin_tables.h jeeps/gpsmath.h jeeps/gpsport.h src/core/file.h \ src/core/xmlstreamwriter.h xmlgeneric.h -yahoo.o: yahoo.cc yahoo.h defs.h config.h zlib/zlib.h zlib/zconf.h cet.h \ - inifile.h gbfile.h session.h src/core/datetime.h src/core/optional.h \ - xmlgeneric.h +yahoo.o: yahoo.cc defs.h config.h zlib/zlib.h zlib/zconf.h config.h \ + formspec.h inifile.h gbfile.h session.h src/core/datetime.h \ + src/core/optional.h yahoo.h format.h xmlgeneric.h zlib/adler32.o: zlib/adler32.c zlib/zutil.h zlib/zlib.h zlib/zconf.h \ config.h zlib/compress.o: zlib/compress.c zlib/zlib.h zlib/zconf.h config.h diff --git a/an1.cc b/an1.cc index 18c7aa867..b773f0f61 100644 --- a/an1.cc +++ b/an1.cc @@ -19,9 +19,19 @@ */ +#include // for sprintf, SEEK_CUR +#include // for int32_t +#include // for atoi, atof +#include // for strlen, strchr, memcpy, strstr + +#include // for QString +#include // for QVector + #include "defs.h" -#include // sprintf -#include // atof +#include "formspec.h" // for FsChainAdd, FsChainFind, FormatSpecificData, kFsAn1L, kFsAn1V, kFsAn1W +#include "gbfile.h" // for gbfgetint32, gbfputint32, gbfputint16, gbfgetint16, gbfile, gbfputs, gbfgetc, gbfputc, gbfclose, gbfopen_le, gbfgetdbl, gbfputdbl, gbfread, gbfseek +#include "src/core/datetime.h" // for DateTime + #define MYNAME "an1" @@ -114,7 +124,7 @@ struct guid_t { static char* ReadString(gbfile* f, short len) { - char* result = (char*)xcalloc(1, len + 1); + auto* result = (char*)xcalloc(1, len + 1); if (len) { gbfread(result, 1, len, f); } @@ -129,10 +139,10 @@ static void ReadGuid(gbfile* f, guid_t* guid) { guid->l = ReadLong(f); - for (unsigned short &i : guid->s) { + for (unsigned short& i : guid->s) { i = ReadShort(f); } - for (unsigned char &i : guid->c) { + for (unsigned char& i : guid->c) { i = ReadChar(f); } } @@ -169,176 +179,129 @@ EncodeOrd(double ord) } struct an1_symbol_record { - short hotspotxhi; - long hotspoty; - long unk1; - guid_t guid; - char* name; + short hotspotxhi{0}; + long hotspoty{0}; + long unk1{0}; + guid_t guid{}; + char* name{nullptr}; }; -struct an1_waypoint_record { - format_specific_data fs; - short magic; - long unk1; - long lon; - long lat; - short type; - long height; - long width; - short unk2; - short unk3; - short serial; - short unk4; - unsigned char create_zoom; - unsigned char visible_zoom; - short unk5; - double radius; /* in km */ - char* name; - char* fontname; - guid_t guid; - long fontcolor; - long fontstyle; - long fontsize; - long outlineweight; - long outlinecolor; - long outlineflags; - long fillcolor; - long unk6; - long fillflags; +struct an1_waypoint_record : FormatSpecificData { + an1_waypoint_record() : FormatSpecificData(kFsAn1W) {} +private: + an1_waypoint_record(const an1_waypoint_record&) = default; +public: + an1_waypoint_record& operator=(const an1_waypoint_record&) = delete; + an1_waypoint_record(an1_waypoint_record&&) = delete; + an1_waypoint_record& operator=(an1_waypoint_record&&) = delete; + ~an1_waypoint_record() override + { + xfree(name); + xfree(fontname); + xfree(url); + xfree(comment); + xfree(image_name); + } - /* Added in SA2006/Topo 6.0 */ - short unk6_1; - char* url; - char* comment; - long creation_time; - long modification_time; - char* image_name; -}; + an1_waypoint_record* clone() const override + { + auto* copy = new an1_waypoint_record(*this); + copy->name = xstrdup(name); + copy->fontname = xstrdup(fontname); + copy->url = xstrdup(url); + copy->comment = xstrdup(comment); + copy->image_name = xstrdup(image_name); + return copy; + } -struct an1_vertex_record { - format_specific_data fs; - short magic; - long unk0; - long lon; - long lat; - short unk1; -}; + short magic{0}; + long unk1{0}; + long lon{0}; + long lat{0}; + short type{0}; + long height{0}; + long width{0}; + short unk2{0}; + short unk3{0}; + short serial{0}; + short unk4{0}; + unsigned char create_zoom{0}; + unsigned char visible_zoom{0}; + short unk5{0}; + double radius{0.0}; /* in km */ + char* name{nullptr}; + char* fontname{nullptr}; + guid_t guid{}; + long fontcolor{0}; + long fontstyle{0}; + long fontsize{0}; + long outlineweight{0}; + long outlinecolor{0}; + long outlineflags{0}; + long fillcolor{0}; + long unk6{0}; + long fillflags{0}; -struct an1_line_record { - format_specific_data fs; - long roadtype; - short serial; - long unk2; - short unk3; - short type; - long unk4; - char* name; - long lineweight; - long linestyle; - long linecolor; - long opacity; - long polyfillcolor; - long unk6; - long unk7; - short unk8; - long pointcount; + /* Added in SA2006/Topo 6.0 */ + short unk6_1{0}; + char* url{nullptr}; + char* comment{nullptr}; + long creation_time{0}; + long modification_time{0}; + char* image_name{nullptr}; }; -static an1_waypoint_record* Alloc_AN1_Waypoint(); - -static void Destroy_AN1_Waypoint(void* vwpt) -{ - - auto* wpt = (an1_waypoint_record*)vwpt; - xfree(wpt->name); - xfree(wpt->fontname); - - if (wpt->url) { - xfree(wpt->url); - } - if (wpt->comment) { - xfree(wpt->comment); - } - if (wpt->image_name) { - xfree(wpt->image_name); +struct an1_vertex_record : FormatSpecificData { + an1_vertex_record() : FormatSpecificData(kFsAn1V) {} + an1_vertex_record* clone() const override + { + return new an1_vertex_record(*this); } - xfree(vwpt); -} - -static void Copy_AN1_Waypoint(void** vdwpt, void* vwpt) -{ - auto* wpt = (an1_waypoint_record*)vwpt; - an1_waypoint_record* dwpt = Alloc_AN1_Waypoint(); - memcpy(dwpt, wpt, sizeof(an1_waypoint_record)); - dwpt->name = xstrdup(wpt->name); - dwpt->fontname = xstrdup(wpt->fontname); - dwpt->url = xstrdup(wpt->url); - dwpt->comment = xstrdup(wpt->comment); - dwpt->image_name = xstrdup(wpt->image_name); - *vdwpt = (void*)dwpt; -} - -static an1_waypoint_record* Alloc_AN1_Waypoint() -{ - auto* result = (an1_waypoint_record*)xcalloc(1, sizeof(an1_waypoint_record)); - result->fs.type = FS_AN1W; - result->fs.copy = Copy_AN1_Waypoint; - result->fs.destroy = Destroy_AN1_Waypoint; - return result; -} -static an1_vertex_record* Alloc_AN1_Vertex(); - -static void Destroy_AN1_Vertex(void* vvertex) -{ - xfree(vvertex); -} - -static void Copy_AN1_Vertex(void** vdvert, void* vvert) -{ - auto* vert = (an1_vertex_record*)vvert; - an1_vertex_record* dvert = Alloc_AN1_Vertex(); - memcpy(dvert, vert, sizeof(an1_vertex_record)); - *vdvert = (void*)dvert; -} - -static an1_vertex_record* Alloc_AN1_Vertex() -{ - auto* result = (an1_vertex_record*)xcalloc(1, sizeof(an1_vertex_record)); - result->fs.type = FS_AN1V; - result->fs.copy = Copy_AN1_Vertex; - result->fs.destroy = Destroy_AN1_Vertex; - return result; -} - - -static an1_line_record* Alloc_AN1_Line(); - -static void Destroy_AN1_Line(void* vline) -{ - auto* line = (an1_line_record*)vline; - xfree(line->name); - xfree(vline); -} + short magic{0}; + long unk0{0}; + long lon{0}; + long lat{0}; + short unk1{0}; +}; -static void Copy_AN1_Line(void** vdline, void* vline) -{ - auto* line = (an1_line_record*)vline; - an1_line_record* dline = Alloc_AN1_Line(); - memcpy(dline, line, sizeof(an1_line_record)); - dline->name = xstrdup(line->name); - *vdline = (void*)dline; -} +struct an1_line_record : FormatSpecificData { + an1_line_record() : FormatSpecificData(kFsAn1L) {} +private: + an1_line_record(const an1_line_record&) = default; +public: + an1_line_record& operator=(const an1_line_record&) = delete; + an1_line_record(an1_line_record&&) = delete; + an1_line_record& operator=(an1_line_record&&) = delete; + ~an1_line_record() override + { + xfree(name); + } -static an1_line_record* Alloc_AN1_Line() -{ - auto* result = (an1_line_record*)xcalloc(1, sizeof(an1_line_record)); - result->fs.type = FS_AN1L; - result->fs.copy = Copy_AN1_Line; - result->fs.destroy = Destroy_AN1_Line; - return result; -} + an1_line_record* clone() const override + { + auto* copy = new an1_line_record(*this); + copy->name = xstrdup(name); + return copy; + } + long roadtype{0}; + short serial{0}; + long unk2{0}; + short unk3{0}; + short type{0}; + long unk4{0}; + char* name{nullptr}; + long lineweight{0}; + long linestyle{0}; + long linecolor{0}; + long opacity{0}; + long polyfillcolor{0}; + long unk6{0}; + long unk7{0}; + short unk8{0}; + long pointcount{0}; +}; static void Destroy_AN1_Symbol(an1_symbol_record* symbol) { @@ -450,8 +413,8 @@ static void Write_AN1_Waypoint(gbfile* f, an1_waypoint_record* wpt) WriteDouble(f, wpt->radius); short len = strlen(wpt->name) + 1 + 2 + 2 + - (wpt->url ? strlen(wpt->url) : 0) + 2 + - (wpt->comment ? strlen(wpt->comment) : 0) + 8 + 8; + (wpt->url ? strlen(wpt->url) : 0) + 2 + + (wpt->comment ? strlen(wpt->comment) : 0) + 8 + 8; WriteShort(f, len); WriteString(f, wpt->name); WriteChar(f, 0); /* name string terminator */ @@ -656,11 +619,11 @@ static void Write_AN1_Bitmaps(gbfile* f) static void Read_AN1_Waypoints(gbfile* f) { - char* icon = nullptr; + const char* icon = nullptr; ReadShort(f); unsigned long count = ReadLong(f); for (unsigned long i = 0; i < count; i++) { - an1_waypoint_record* rec = Alloc_AN1_Waypoint(); + auto* rec = new an1_waypoint_record; Read_AN1_Waypoint(f, rec); auto* wpt_tmp = new Waypoint; @@ -692,7 +655,7 @@ static void Read_AN1_Waypoints(gbfile* f) wpt_tmp->icon_descr = icon; } - fs_chain_add(&(wpt_tmp->fs), (format_specific_data*)rec); + wpt_tmp->fs.FsChainAdd(rec); rec = nullptr; waypt_add(wpt_tmp); } @@ -702,19 +665,16 @@ static void Write_One_AN1_Waypoint(const Waypoint* wpt) { an1_waypoint_record* rec; - bool local; - format_specific_data* fs = fs_chain_find(wpt->fs, FS_AN1W); - if (fs) { - rec = (an1_waypoint_record*)fs; - xfree(rec->name); - local = false; + const auto* source_rec = reinterpret_cast(wpt->fs.FsChainFind(kFsAn1W)); + + if (source_rec != nullptr) { + rec = source_rec->clone(); if (opt_zoom) { rec->visible_zoom = opt_zoom_num; } } else { - rec = Alloc_AN1_Waypoint(); - local = true; + rec = new an1_waypoint_record; rec->magic = 1; rec->type = wpt_type_num; rec->unk2 = 3; @@ -733,11 +693,12 @@ Write_One_AN1_Waypoint(const Waypoint* wpt) rec->visible_zoom = opt_zoom?opt_zoom_num:10; rec->unk6_1 = 1; } + xfree(rec->name); rec->name = xstrdup(wpt->description); if (!nogc && wpt->gc_data->id) { // FIXME: this whole mess should be qstring concatenation - char* extra = (char*) xmalloc(25 + wpt->gc_data->placer.length() + wpt->shortname.length()); + auto* extra = (char*) xmalloc(25 + wpt->gc_data->placer.length() + wpt->shortname.length()); sprintf(extra, "\r\nBy %s\r\n%s (%1.1f/%1.1f)", CSTR(wpt->gc_data->placer), CSTRc(wpt->shortname), wpt->gc_data->diff/10.0, @@ -749,11 +710,11 @@ Write_One_AN1_Waypoint(const Waypoint* wpt) if (!nourl && wpt->HasUrlLink()) { UrlLink l = wpt->GetUrlLink(); int len = 7 + l.url_.length(); - char* extra = (char*)xmalloc(len); + auto* extra = (char*)xmalloc(len); sprintf(extra, "{URL=%s}", CSTR(l.url_)); rec->name = xstrappend(rec->name, extra); xfree(extra); - if(rec->url) { + if (rec->url) { xfree(rec->url); } rec->url = xstrdup(l.url_); @@ -783,9 +744,7 @@ Write_One_AN1_Waypoint(const Waypoint* wpt) } Write_AN1_Waypoint(outfile, rec); - if (local) { - Destroy_AN1_Waypoint(rec); - } + delete rec; } static void Write_AN1_Waypoints(gbfile* f) @@ -800,7 +759,7 @@ static void Read_AN1_Lines(gbfile* f) ReadShort(f); unsigned long count = ReadLong(f); for (unsigned long i = 0; i < count; i++) { - an1_line_record* rec = Alloc_AN1_Line(); + auto* rec = new an1_line_record; Read_AN1_Line(f, rec); /* create route rec */ auto* rte_head = new route_head; @@ -815,10 +774,10 @@ static void Read_AN1_Lines(gbfile* f) rte_head->line_width = rec->lineweight; } rte_head->rte_name = rec->name; - fs_chain_add(&rte_head->fs, (format_specific_data*)rec); + rte_head->fs.FsChainAdd(rec); route_add_head(rte_head); for (unsigned long j = 0; j < (unsigned) rec->pointcount; j++) { - an1_vertex_record* vert = Alloc_AN1_Vertex(); + auto* vert = new an1_vertex_record; Read_AN1_Vertex(f, vert); /* create route point */ @@ -826,8 +785,7 @@ static void Read_AN1_Lines(gbfile* f) wpt_tmp->latitude = DecodeOrd(vert->lat); wpt_tmp->longitude = -DecodeOrd(vert->lon); wpt_tmp->shortname = QString::asprintf("\\%5.5lx", rtserial++); - fs_chain_add(&wpt_tmp->fs, - (format_specific_data*)vert); + wpt_tmp->fs.FsChainAdd(vert); route_add_wpt(rte_head, wpt_tmp); } } @@ -859,19 +817,14 @@ static void Write_One_AN1_Line(const route_head* rte) { an1_line_record* rec; - int local; - format_specific_data* fs = fs_chain_find(rte->fs, FS_AN1L); + const auto* source_rec = reinterpret_cast(rte->fs.FsChainFind(kFsAn1L)); - if (fs) { - rec = (an1_line_record*)(void*)fs; - local = 0; + if (source_rec != nullptr) { + rec = source_rec->clone(); switch (output_type_num) { case 1: if (rec->type != 14) { - rec = Alloc_AN1_Line(); - memcpy(rec, fs, sizeof(an1_line_record)); - local = 1; rec->roadtype = 0x11100541; rec->unk2 = 655360; rec->type = 14; @@ -881,27 +834,20 @@ Write_One_AN1_Line(const route_head* rte) break; case 2: if (rec->type != 15) { - rec = Alloc_AN1_Line(); - memcpy(rec, fs, sizeof(an1_line_record)); - local = 1; rec->type = 15; } // end if break; case 4: if (rec->type != 16) { - rec = Alloc_AN1_Line(); - memcpy(rec, fs, sizeof(an1_line_record)); - local = 1; rec->type = 16; } // end if break; } } else { - rec = Alloc_AN1_Line(); - local = 1; + rec = new an1_line_record; rec->name = nullptr; switch (output_type_num) { - /* drawing road trail waypoint track */ + /* drawing road trail waypoint track */ case 1: /* road */ rec->roadtype = 0x11100541; rec->unk2 = 655360; @@ -946,34 +892,27 @@ Write_One_AN1_Line(const route_head* rte) rec->serial = serial++; rec->pointcount = rte->rte_waypt_ct; Write_AN1_Line(outfile, rec); - if (local) { - Destroy_AN1_Line(rec); - } + delete rec; } static void Write_One_AN1_Vertex(const Waypoint* wpt) { an1_vertex_record* rec; - int local; - format_specific_data* fs = fs_chain_find(wpt->fs, FS_AN1V); + const auto* source_rec = reinterpret_cast(wpt->fs.FsChainFind(kFsAn1V)); - if (fs) { - rec = (an1_vertex_record*)(void*)fs; - local = 0; + if (source_rec != nullptr) { + rec = source_rec->clone(); } else { - rec = Alloc_AN1_Vertex(); - local = 1; + rec = new an1_vertex_record; rec->magic = 1; } rec->lat = EncodeOrd(wpt->latitude); rec->lon = EncodeOrd(-wpt->longitude); Write_AN1_Vertex(outfile, rec); - if (local) { - Destroy_AN1_Vertex(rec); - } + delete rec; } static void Write_AN1_Lines(gbfile* f) diff --git a/an1sym.h b/an1sym.h index bf78756b3..df9bca6ed 100644 --- a/an1sym.h +++ b/an1sym.h @@ -710,20 +710,23 @@ static struct defguid { static int FindIconByName(const char* name, guid_t* guid) { - for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); i++) { + for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); ++i) { if (!case_ignore_strcmp(name, default_guids[i].name)) { - memcpy(guid, &(default_guids[i].guid), sizeof(guid_t)); + *guid = default_guids[i].guid; return 1; } } return 0; } -static int FindIconByGuid(guid_t* guid, char** name) +static int FindIconByGuid(const guid_t* guid, const char** name) { - for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); i++) { - if (!memcmp(guid, &default_guids[i].guid, sizeof(guid_t))) { - *name = const_cast(default_guids[i].name); + for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); ++i) { + /* don't compare any structure padding */ + if ((guid->l == default_guids[i].guid.l) && + memcmp(guid->s, default_guids[i].guid.s, sizeof(guid->s)) && + memcmp(guid->c, default_guids[i].guid.c, sizeof(guid->c))) { + *name = default_guids[i].name; return 1; } } diff --git a/bend.cc b/bend.cc index 22b0e639b..058827667 100644 --- a/bend.cc +++ b/bend.cc @@ -149,7 +149,7 @@ void BendFilter::process_route_orig(const route_head* route_orig) auto* route_dest = new route_head; route_dest->rte_name = route_orig->rte_name; route_dest->rte_desc = route_orig->rte_desc; - route_dest->fs = fs_chain_copy(route_orig->fs); + route_dest->fs = route_orig->fs.FsChainCopy(); route_dest->rte_num = route_orig->rte_num; route_add_head(route_dest); diff --git a/defs.h b/defs.h index 6cd0bd00f..f5dc7ffdc 100644 --- a/defs.h +++ b/defs.h @@ -36,8 +36,6 @@ #include "zlib.h" // doesn't really belong here, but is missing elsewhere. #endif -#include // for QByteArray -#include // for QChar #include // for QList, QList<>::const_reverse_iterator, QList<>::reverse_iterator #include // for QString #include // for QStringRef @@ -46,7 +44,7 @@ #include // for CaseInsensitive #include // for foreach -#include "cet.h" // for cet_cs_vec_t +#include "formspec.h" // for FormatSpecificData #include "inifile.h" // for inifile_t #include "gbfile.h" // doesn't really belong here, but is missing elsewhere. #include "session.h" // for session_t @@ -306,17 +304,6 @@ public: QString personal_note; }; -using fs_destroy = void (*)(void*); -using fs_copy = void (*)(void**, void*); - -struct format_specific_data { - long type{0}; - format_specific_data* next{nullptr}; - - fs_destroy destroy{nullptr}; - fs_copy copy{nullptr}; -}; - class gb_color { public: @@ -324,20 +311,6 @@ public: unsigned char opacity{255}; // 0 == transparent. 255 == opaque. }; - -format_specific_data* fs_chain_copy(format_specific_data* source); -void fs_chain_destroy(format_specific_data* chain); -format_specific_data* fs_chain_find(format_specific_data* chain, long type); -void fs_chain_add(format_specific_data** chain, format_specific_data* data); - -#define FS_GPX 0x67707800L -#define FS_AN1W 0x616e3177L -#define FS_AN1L 0x616e316cL -#define FS_AN1V 0x616e3176L -#define FS_OZI 0x6f7a6900L -#define FS_GMSD 0x474d5344L /* GMSD = Garmin specific data */ -#define FS_LOWRANCEUSR4 0x615f234cL - /* * Structures and functions for multiple URLs per waypoint. */ @@ -548,7 +521,7 @@ public: float temperature; /* Degrees celsius */ float odometer_distance; /* Meters? */ geocache_data* gc_data; - format_specific_data* fs; + FormatSpecificDataList fs; const session_t* session; /* pointer to a session struct */ void* extra_data; /* Extra data added by, say, a filter. */ @@ -717,7 +690,7 @@ public: UrlList rte_urls; int rte_num; int rte_waypt_ct; /* # waypoints in waypoint list */ - format_specific_data* fs; + FormatSpecificDataList fs; gb_color line_color; /* Optional line color for rendering */ int line_width; /* in pixels (sigh). < 0 is unknown. */ const session_t* session; /* pointer to a session struct */ diff --git a/destinator.cc b/destinator.cc index e0b42272c..27d1f175e 100644 --- a/destinator.cc +++ b/destinator.cc @@ -69,7 +69,7 @@ gmsd_init(Waypoint* wpt) garmin_fs_t* gmsd = garmin_fs_t::find(wpt); if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); } return gmsd; } diff --git a/formspec.cc b/formspec.cc index 7fd303fe9..446241a67 100644 --- a/formspec.cc +++ b/formspec.cc @@ -1,5 +1,5 @@ /* - Functions to manage the format_specific_data chain + Functions to manage the FormatSpecificData chain Copyright (C) 2005 Ron Parker and Robert Lipe. @@ -19,48 +19,40 @@ */ +#include // for QList + #include "defs.h" +#include "formspec.h" // for FormatSpecificData, FsChainAdd, FsChainCopy, FsChainDestroy, FsChainFind -format_specific_data* fs_chain_copy(format_specific_data* source) +FormatSpecificDataList FormatSpecificDataList::FsChainCopy() const { - format_specific_data* result = nullptr; - - format_specific_data** copy = &result; - while (source) { - source->copy((void**)copy, (void*)source); - /* prevent segfaults from badly-behaved copy functions */ - (*copy)->next = nullptr; - copy = &((*copy)->next); - source = source->next; + FormatSpecificDataList dest; + for (const auto* item : *this) { + dest.append(item->clone()); } - return result; + return dest; } -void fs_chain_destroy(format_specific_data* chain) +void FormatSpecificDataList::FsChainDestroy() { - format_specific_data* cur = chain; - while (cur) { - format_specific_data* next = cur->next; - cur->destroy(cur); - cur = next; + while (!isEmpty()) { + delete takeFirst(); } } -format_specific_data* fs_chain_find(format_specific_data* chain, long type) +FormatSpecificData* FormatSpecificDataList::FsChainFind(FsType type) const { - format_specific_data* cur = chain; - while (cur) { - if (cur->type == type) { - return cur; + for (auto* item : *this) { + if (item->fs_type == type) { + return item; } - cur = cur->next; } return nullptr; } -void fs_chain_add(format_specific_data** chain, format_specific_data* data) +void FormatSpecificDataList::FsChainAdd(FormatSpecificData* data) { - data->next = *chain; - *chain = data; + if (data != nullptr) { + append(data); + } } - diff --git a/formspec.h b/formspec.h new file mode 100644 index 000000000..075c54ab1 --- /dev/null +++ b/formspec.h @@ -0,0 +1,60 @@ +/* + Functions to manage the FormatSpecificData chain + + Copyright (C) 2005 Ron Parker and Robert Lipe. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + */ +#ifndef FORMSPEC_H_INCLUDED_ +#define FORMSPEC_H_INCLUDED_ + +#include // for QList + +enum FsType { + kFsUnknown = 0L, + kFsGpx = 0x67707800L, + kFsAn1W = 0x616e3177L, + kFsAn1L = 0x616e316cL, + kFsAn1V = 0x616e3176L, + kFsOzi = 0x6f7a6900L, + kFsGmsd = 0x474d5344L, /* GMSD = Garmin specific data */ + kFsLowranceusr4 = 0x615f234cL +}; + +struct FormatSpecificData { + FormatSpecificData() = default; + explicit FormatSpecificData(FsType type) : fs_type(type) {} + FormatSpecificData(const FormatSpecificData&) = default; + FormatSpecificData& operator=(const FormatSpecificData&) = default; + FormatSpecificData(FormatSpecificData&&) = delete; + FormatSpecificData& operator=(FormatSpecificData&&) = delete; + virtual ~FormatSpecificData() = default; + + virtual FormatSpecificData* clone() const = 0; + + FsType fs_type{kFsUnknown}; +}; + +class FormatSpecificDataList : private QList +{ +public: + FormatSpecificDataList FsChainCopy() const; + void FsChainDestroy(); + FormatSpecificData* FsChainFind(FsType type) const; + void FsChainAdd(FormatSpecificData* data); +}; + +#endif // FORMSPEC_H_INCLUDED_ diff --git a/g7towin.cc b/g7towin.cc index ed2fa0552..a0fc62cb1 100644 --- a/g7towin.cc +++ b/g7towin.cc @@ -75,7 +75,7 @@ static void parse_line(char* buff, int index, const char* delimiter, Waypoint* wpt) { char* cin; - garmin_fs_p gmsd = garmin_fs_t::find(wpt); + garmin_fs_t* gmsd = garmin_fs_t::find(wpt); while ((cin = csv_lineparse(buff, delimiter, "", index++))) { @@ -273,8 +273,8 @@ parse_waypt(char* buff) struct tm tm; auto* wpt = new Waypoint; - garmin_fs_p gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + garmin_fs_t* gmsd = garmin_fs_alloc(-1); + wpt->fs.FsChainAdd(gmsd); if (gardown) { cin = buff + 6; @@ -344,8 +344,8 @@ static Waypoint* parse_trkpt(char* buff) { auto* wpt = new Waypoint; - garmin_fs_p gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + garmin_fs_t* gmsd = garmin_fs_alloc(-1); + wpt->fs.FsChainAdd(gmsd); parse_line(buff, TRKPT__OFS, ";", wpt); diff --git a/garmin_fs.cc b/garmin_fs.cc index 973255f08..232d7f339 100644 --- a/garmin_fs.cc +++ b/garmin_fs.cc @@ -20,17 +20,23 @@ */ +#include // for assert +#include // for snprintf, sscanf +#include // for atof +#include // for strncpy + +#include // for QByteArray +#include // for QStaticStringData +#include // for QString, QStringLiteral +#include // for QXmlStreamWriter +#include // for CaseInsensitive + #include "defs.h" -#include "cet_util.h" #include "garmin_fs.h" -#include "garmin_tables.h" -#include "inifile.h" +#include "garmin_tables.h" // for gt_switch_display_mode_value, gt_display_mode_symbol, gt_display_mode_symbol_and_comment, gt_display_mode_symbol_and_name +#include "inifile.h" // for inifile_readstr +#include "jeeps/gps.h" // for gps_waypt_type -#include -#include -#include -#include -#include #define MYNAME "garmin_fs" @@ -38,20 +44,26 @@ garmin_fs_t* garmin_fs_alloc(const int protocol) { auto* result = new garmin_fs_t; - result->fs.type = FS_GMSD; - result->fs.copy = (fs_copy) garmin_fs_copy; - result->fs.destroy = garmin_fs_destroy; - result->fs.next = nullptr; result->protocol = protocol; return result; } -void -garmin_fs_destroy(void* fs) +garmin_fs_t* garmin_fs_t::clone() const { - delete (garmin_fs_t*) fs; + auto* copy = new garmin_fs_t(*this); + + /* do not deep copy interlinks, only increment the reference counter */ + if (ilinks != nullptr) { + ilinks->ref_count++; + } + +#ifdef GMSD_EXPERIMENTAL + memcopy(subclass, other.subclass, sizeof(subclass)); +#endif + + return copy; } garmin_fs_t::~garmin_fs_t() @@ -69,47 +81,6 @@ garmin_fs_t::~garmin_fs_t() } } -void garmin_fs_copy(garmin_fs_t** dest, garmin_fs_t* src) -{ - if (src == nullptr) { - *dest = nullptr; - return; - } - *dest = new garmin_fs_t(*src); -} - -garmin_fs_t::garmin_fs_t(const garmin_fs_t& other) : - fs(other.fs), - flags(other.flags), - protocol(other.protocol), - icon(other.icon), - wpt_class(other.wpt_class), - display(other.display), - category(other.category), - city(other.city), - facility(other.facility), - state(other.state), - cc(other.cc), - cross_road(other.cross_road), - addr(other.addr), - country(other.country), - phone_nr(other.phone_nr), - phone_nr2(other.phone_nr2), - fax_nr(other.fax_nr), - postal_code(other.postal_code), - email(other.email), - ilinks(other.ilinks) -{ - /* do not deep copy interlinks, only increment the reference counter */ - if (ilinks != nullptr) { - ilinks->ref_count++; - } - -#ifdef GMSD_EXPERIMENTAL - memcopy(subclass, other.subclass, sizeof(subclass)); -#endif -} - /* GPX - out */ void @@ -224,7 +195,7 @@ garmin_fs_xml_convert(const int base_tag, int tag, const QString& qstr, Waypoint garmin_fs_t* gmsd = garmin_fs_t::find(waypt); if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&waypt->fs, (format_specific_data*) gmsd); + waypt->fs.FsChainAdd(gmsd); } tag -= base_tag; @@ -350,7 +321,7 @@ garmin_fs_merge_category(const char* category_name, Waypoint* waypt) if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&waypt->fs, (format_specific_data*) gmsd); + waypt->fs.FsChainAdd(gmsd); } garmin_fs_t::set_category(gmsd, cat); return 1; @@ -360,7 +331,7 @@ void garmin_fs_garmin_after_read(const GPS_PWay way, Waypoint* wpt, const int protoid) { garmin_fs_t* gmsd = garmin_fs_alloc(protoid); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); /* nothing happens until gmsd is allocated some lines above */ diff --git a/garmin_fs.h b/garmin_fs.h index 0ee77300c..cd68fc184 100644 --- a/garmin_fs.h +++ b/garmin_fs.h @@ -24,9 +24,17 @@ #ifndef GARMIN_FS_H #define GARMIN_FS_H +#include // for size_t +#include // for int32_t, int16_t, uint16_t + +#include // for QString +#include // for QXmlStreamWriter + #include "defs.h" +#include "formspec.h" // for FsChainFind, kFsGmsd, FormatSpecificData #include "jeeps/gps.h" + /* this order is used by most devices */ /* enum garmin_display_t { garmin_display_symbol_and_name = 0, @@ -86,9 +94,8 @@ public: #endif }; -class garmin_fs_t { +class garmin_fs_t : public FormatSpecificData { public: - format_specific_data fs; garmin_fs_flags_t flags; int protocol{0}; /* ... used by device (-1 is MapSource) */ @@ -115,15 +122,18 @@ public: #endif public: - garmin_fs_t() = default; - ~garmin_fs_t(); - garmin_fs_t(const garmin_fs_t& other); + garmin_fs_t() : FormatSpecificData(kFsGmsd) {} +private: + garmin_fs_t(const garmin_fs_t& other) = default; +public: garmin_fs_t& operator=(const garmin_fs_t& rhs) = delete; /* not implemented */ garmin_fs_t(garmin_fs_t&&) = delete; /* not implemented */ garmin_fs_t& operator=(garmin_fs_t&&) = delete; /* not implemented */ + ~garmin_fs_t() override; + garmin_fs_t* clone() const override; static garmin_fs_t* find(const Waypoint* wpt) { - return (garmin_fs_t*) fs_chain_find(wpt->fs, FS_GMSD); + return reinterpret_cast(wpt->fs.FsChainFind(kFsGmsd)); } #define GEN_GMSD_METHODS(field) \ @@ -201,17 +211,14 @@ public: #undef GEN_GMSD_STR_METHODS }; -using garmin_fs_p = garmin_fs_t*; garmin_fs_t* garmin_fs_alloc(int protocol); void garmin_fs_destroy(void* fs); -void garmin_fs_copy(garmin_fs_t** dest, garmin_fs_t* src); -void garmin_fs_convert(void* fs); +void garmin_fs_copy(void** dest, const void* src); char* garmin_fs_xstrdup(const char* src, size_t size); /* for GPX */ void garmin_fs_xml_convert(int base_tag, int tag, const QString& qstr, Waypoint* waypt); -class QXmlStreamWriter; void garmin_fs_xml_fprint(const Waypoint* waypt, QXmlStreamWriter*); /* common garmin_fs utilities */ diff --git a/garmin_gpi.cc b/garmin_gpi.cc index d68db9e46..952962e0c 100644 --- a/garmin_gpi.cc +++ b/garmin_gpi.cc @@ -249,7 +249,7 @@ gpi_gmsd_init(Waypoint* wpt) } if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); } return gmsd; } diff --git a/garmin_txt.cc b/garmin_txt.cc index 9abbeda58..03b83a643 100644 --- a/garmin_txt.cc +++ b/garmin_txt.cc @@ -41,7 +41,7 @@ #include // for qPrintable #include "csv_util.h" // for csv_lineparse -#include "garmin_fs.h" // for garmin_fs_t, garmin_fs_alloc, garmin_fs_convert_category, garmin_fs_p, GMSD_SECTION_CATEGORIES +#include "garmin_fs.h" // for garmin_fs_t, garmin_fs_alloc, garmin_fs_convert_category, GMSD_SECTION_CATEGORIES #include "garmin_tables.h" // for gt_display_modes_e, gt_find_desc_from_icon_number, gt_find_icon_number_from_desc, gt_get_mps_grid_longname, gt_lookup_datum_index, gt_lookup_grid_type, GDB, gt_get_icao_cc, gt_get_icao_country, gt_get_mps_datum_name, gt_waypt_class_names, GT_DISPLAY_MODE... #include "inifile.h" // for inifile_readstr #include "jeeps/gpsmath.h" // for GPS_Math_Known_Datum_To_UTM_EN, GPS_Math_WGS84_To_Known_Datum_M, GPS_Math_WGS84_To_Swiss_EN, GPS_Math_WGS84_To_UKOSMap_M @@ -215,7 +215,7 @@ convert_datum(const Waypoint* wpt, double* dest_lat, double* dest_lon) static void enum_waypt_cb(const Waypoint* wpt) { - garmin_fs_p gmsd = garmin_fs_t::find(wpt); + garmin_fs_t* gmsd = garmin_fs_t::find(wpt); int wpt_class = garmin_fs_t::get_wpt_class(gmsd, 0); if (wpt_class < 0x80) { if (gtxt_flags.enum_waypoints) { /* enumerate only */ @@ -535,7 +535,7 @@ write_waypt(const Waypoint* wpt) { const char* wpt_type; - garmin_fs_p gmsd = garmin_fs_t::find(wpt); + garmin_fs_t* gmsd = garmin_fs_t::find(wpt); int i = garmin_fs_t::get_display(gmsd, 0); if (i > GT_DISPLAY_MODE_MAX) { @@ -1090,8 +1090,8 @@ parse_waypoint() bind_fields(waypt_header); auto* wpt = new Waypoint; - garmin_fs_p gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + garmin_fs_t* gmsd = garmin_fs_alloc(-1); + wpt->fs.FsChainAdd(gmsd); while ((str = csv_lineparse(nullptr, "\t", "", column++))) { int i; diff --git a/gdb.cc b/gdb.cc index 1621a8bf8..d32664cab 100644 --- a/gdb.cc +++ b/gdb.cc @@ -437,7 +437,7 @@ read_waypoint(gt_waypt_classes_e* waypt_class_out) res = new Waypoint; gmsd = garmin_fs_alloc(-1); - fs_chain_add(&res->fs, (format_specific_data*) gmsd); + res->fs.FsChainAdd(gmsd); res->shortname = fread_cstr(); wpt_class = (gt_waypt_classes_e) FREAD_i32; garmin_fs_t::set_wpt_class(gmsd, wpt_class); @@ -818,7 +818,7 @@ read_route() garmin_fs_t* gmsd = garmin_fs_t::find(wpt); if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); } garmin_fs_t::set_wpt_class(gmsd, wpt_class); gmsd->ilinks = il_root; diff --git a/gpx.cc b/gpx.cc index e55e7e0bd..c2b503314 100644 --- a/gpx.cc +++ b/gpx.cc @@ -34,7 +34,6 @@ #include // for QStringList #include // for QStringRef #include // for QTime -#include // for QVector #include // for QVersionNumber #include // for QXmlStreamAttribute #include // for QXmlStreamAttributes @@ -266,7 +265,7 @@ GpxFormat::start_something_else(const QString& el, const QXmlStreamAttributes& a new_tag->parent = cur_tag; } } else { - auto* fs_gpx = (fs_xml*)fs_chain_find(*fs_ptr, FS_GPX); + const auto* fs_gpx = reinterpret_cast(fs_ptr->FsChainFind(kFsGpx)); if (fs_gpx && fs_gpx->tag) { cur_tag = fs_gpx->tag; @@ -276,9 +275,9 @@ GpxFormat::start_something_else(const QString& el, const QXmlStreamAttributes& a cur_tag->sibling = new_tag; new_tag->parent = nullptr; } else { - fs_gpx = fs_xml_alloc(FS_GPX); - fs_gpx->tag = new_tag; - fs_chain_add(fs_ptr, (format_specific_data*)fs_gpx); + fs_xml* new_fs_gpx = fs_xml_alloc(kFsGpx); + new_fs_gpx->tag = new_tag; + fs_ptr->FsChainAdd(new_fs_gpx); new_tag->parent = nullptr; } } @@ -1407,7 +1406,7 @@ GpxFormat::gpx_waypt_pr(const Waypoint* waypointp) gpx_write_common_acc(waypointp); if (!(opt_humminbirdext || opt_garminext)) { - auto* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(waypointp->fs.FsChainFind(kFsGpx)); auto* gmsd = garmin_fs_t::find(waypointp); /* gARmIN sPECIAL dATA */ if (fs_gpx) { if (! gmsd) { @@ -1440,7 +1439,7 @@ GpxFormat::gpx_track_hdr(const route_head* rte) if (gpx_write_version > gpx_1_0) { if (!(opt_humminbirdext || opt_garminext)) { - auto* fs_gpx = (fs_xml*)fs_chain_find(rte->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(rte->fs.FsChainFind(kFsGpx)); if (fs_gpx) { fprint_xml_chain(fs_gpx->tag, nullptr); } @@ -1487,7 +1486,7 @@ GpxFormat::gpx_track_disp(const Waypoint* waypointp) gpx_write_common_acc(waypointp); if (!(opt_humminbirdext || opt_garminext)) { - auto* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(waypointp->fs.FsChainFind(kFsGpx)); if (fs_gpx) { fprint_xml_chain(fs_gpx->tag, waypointp); } @@ -1538,7 +1537,7 @@ GpxFormat::gpx_route_hdr(const route_head* rte) if (gpx_write_version > gpx_1_0) { if (!(opt_humminbirdext || opt_garminext)) { - auto* fs_gpx = (fs_xml*)fs_chain_find(rte->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(rte->fs.FsChainFind(kFsGpx)); if (fs_gpx) { fprint_xml_chain(fs_gpx->tag, nullptr); } @@ -1575,7 +1574,7 @@ GpxFormat::gpx_route_disp(const Waypoint* waypointp) gpx_write_common_acc(waypointp); if (!(opt_humminbirdext || opt_garminext)) { - auto* fs_gpx = (fs_xml*)fs_chain_find(waypointp->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(waypointp->fs.FsChainFind(kFsGpx)); if (fs_gpx) { fprint_xml_chain(fs_gpx->tag, waypointp); } diff --git a/gpx.h b/gpx.h index 2ef8d6aae..ab5036586 100644 --- a/gpx.h +++ b/gpx.h @@ -22,6 +22,7 @@ #define GPX_H_INCLUDED_ #include // for QHash +#include // for QList #include // for QString #include // for QStringList #include // for QVector @@ -31,6 +32,7 @@ #include "defs.h" #include "format.h" // for Format +#include "formspec.h" // for FormatSpecificData #include "src/core/file.h" // for File #include "src/core/xmlstreamwriter.h" // for XmlStreamWriter #include "src/core/xmltag.h" // for xml_tag @@ -261,7 +263,7 @@ private: bounds all_bounds; int next_trkpt_is_new_seg; - format_specific_data** fs_ptr; + FormatSpecificDataList* fs_ptr; /* * The file-level information. diff --git a/html.cc b/html.cc index 5f2d56f64..20c33cb9d 100644 --- a/html.cc +++ b/html.cc @@ -27,6 +27,7 @@ #include // for CaseInsensitive #include "defs.h" +#include "formspec.h" // for FsChainFind, kFsGpx #include "gbfile.h" // for gbfprintf, gbfclose, gbfopen, gbfputs, gbfile #include "jeeps/gpsmath.h" // for GPS_Math_WGS84_To_UTM_EN #include "src/core/datetime.h" // for DateTime @@ -156,73 +157,71 @@ html_disp(const Waypoint* wpt) gbfprintf(file_out, "

%s

\n", CSTR(wpt->notes)); } - fs_xml* fs_gpx = nullptr; if (includelogs) { - fs_gpx = (fs_xml*)fs_chain_find(wpt->fs, FS_GPX); - } - - if (fs_gpx && fs_gpx->tag) { - xml_tag* root = fs_gpx->tag; - xml_tag* curlog = xml_findfirst(root, "groundspeak:log"); - while (curlog) { - time_t logtime = 0; - gbfprintf(file_out, "

\n"); + const auto* fs_gpx = reinterpret_cast(wpt->fs.FsChainFind(kFsGpx)); + if (fs_gpx && fs_gpx->tag) { + xml_tag* root = fs_gpx->tag; + xml_tag* curlog = xml_findfirst(root, "groundspeak:log"); + while (curlog) { + time_t logtime = 0; + gbfprintf(file_out, "

\n"); + + xml_tag* logpart = xml_findfirst(curlog, "groundspeak:type"); + if (logpart) { + gbfprintf(file_out, "%s by ", CSTR(logpart->cdata)); + } - xml_tag* logpart = xml_findfirst(curlog, "groundspeak:type"); - if (logpart) { - gbfprintf(file_out, "%s by ", CSTR(logpart->cdata)); - } + logpart = xml_findfirst(curlog, "groundspeak:finder"); + if (logpart) { + char* f = html_entitize(CSTR(logpart->cdata)); + gbfprintf(file_out, "%s on ", f); + xfree(f); + } - logpart = xml_findfirst(curlog, "groundspeak:finder"); - if (logpart) { - char* f = html_entitize(CSTR(logpart->cdata)); - gbfprintf(file_out, "%s on ", f); - xfree(f); - } + logpart = xml_findfirst(curlog, "groundspeak:date"); + if (logpart) { + logtime = xml_parse_time(logpart->cdata).toTime_t(); + struct tm* logtm = localtime(&logtime); + if (logtm) { + gbfprintf(file_out, + "%04d-%02d-%02d
\n", + logtm->tm_year+1900, + logtm->tm_mon+1, + logtm->tm_mday); + } + } - logpart = xml_findfirst(curlog, "groundspeak:date"); - if (logpart) { - logtime = xml_parse_time(logpart->cdata).toTime_t(); - struct tm* logtm = localtime(&logtime); - if (logtm) { + logpart = xml_findfirst(curlog, "groundspeak:log_wpt"); + if (logpart) { + double lat = xml_attribute(logpart->attributes, "lat").toDouble(); + double lon = xml_attribute(logpart->attributes, "lon").toDouble(); + char* coordstr = pretty_deg_format(lat, lon, degformat[2], " ", 1); gbfprintf(file_out, - "%04d-%02d-%02d
\n", - logtm->tm_year+1900, - logtm->tm_mon+1, - logtm->tm_mday); + "%s
\n", + coordstr); + xfree(coordstr); } - } - - logpart = xml_findfirst(curlog, "groundspeak:log_wpt"); - if (logpart) { - double lat = xml_attribute(logpart->attributes, "lat").toDouble(); - double lon = xml_attribute(logpart->attributes, "lon").toDouble(); - char* coordstr = pretty_deg_format(lat, lon, degformat[2], " ", 1); - gbfprintf(file_out, - "%s
\n", - coordstr); - xfree(coordstr); - } - - logpart = xml_findfirst(curlog, "groundspeak:text"); - if (logpart) { - QString encstr = xml_attribute(logpart->attributes, "encoded"); - bool encoded = !encstr.startsWith('F', Qt::CaseInsensitive); - QString s; - if (html_encrypt && encoded) { - s = rot13(logpart->cdata); - } else { - s = logpart->cdata; + logpart = xml_findfirst(curlog, "groundspeak:text"); + if (logpart) { + QString encstr = xml_attribute(logpart->attributes, "encoded"); + bool encoded = !encstr.startsWith('F', Qt::CaseInsensitive); + + QString s; + if (html_encrypt && encoded) { + s = rot13(logpart->cdata); + } else { + s = logpart->cdata; + } + + char* t = html_entitize(s); + gbfputs(t, file_out); + xfree(t); } - char* t = html_entitize(s); - gbfputs(t, file_out); - xfree(t); + gbfprintf(file_out, "

\n"); + curlog = xml_findnext(root, curlog, "groundspeak:log"); } - - gbfprintf(file_out, "

\n"); - curlog = xml_findnext(root, curlog, "groundspeak:log"); } } gbfprintf(file_out, "\n"); diff --git a/interpolate.cc b/interpolate.cc index 9d245182c..bd8e1a348 100644 --- a/interpolate.cc +++ b/interpolate.cc @@ -60,7 +60,7 @@ void InterpolateFilter::process() rte_new->rte_desc = rte_old->rte_desc; rte_new->rte_urls = rte_old->rte_urls; rte_new->rte_num = rte_old->rte_num; - rte_new->fs = fs_chain_copy(rte_old->fs); + rte_new->fs = rte_old->fs.FsChainCopy(); rte_new->line_color = rte_old->line_color; rte_new->line_width = rte_old->line_width; rte_new->session = rte_old->session; diff --git a/kml.cc b/kml.cc index f218db759..1302fb3cf 100644 --- a/kml.cc +++ b/kml.cc @@ -47,6 +47,7 @@ #include // for foreach, qint64, qPrintable #include "defs.h" +#include "formspec.h" // for FsChainFind, kFsGpx #include "grtcirc.h" // for RAD, gcdist, radtometers #include "src/core/datetime.h" // for DateTime #include "src/core/file.h" // for File @@ -1433,7 +1434,7 @@ static QString kml_geocache_get_logs(const Waypoint* wpt) { QString r; - auto* fs_gpx = (fs_xml*)fs_chain_find(wpt->fs, FS_GPX); + const auto* fs_gpx = reinterpret_cast(wpt->fs.FsChainFind(kFsGpx)); if (!fs_gpx) { return r; diff --git a/lowranceusr.cc b/lowranceusr.cc index 414a8af64..09b84a4eb 100644 --- a/lowranceusr.cc +++ b/lowranceusr.cc @@ -108,6 +108,7 @@ #include // for qPrintable, uint, qAsConst, QAddConst<>::Type #include "defs.h" +#include "formspec.h" // for FsChainFind, FsChainAdd, kFsLowranceusr4, FormatSpecificData #include "gbfile.h" // for gbfgetint32, gbfputint32, gbfputint16, gbfgetc, gbfgetint16, gbfwrite, gbfputc, gbfeof, gbfgetflt, gbfclose, gbfgetdbl, gbfopen_le, gbfputdbl, gbfputs, gbfile, gbfputflt, gbfread, gbfseek #include "src/core/datetime.h" // for DateTime #include "src/core/logging.h" // for Warning @@ -370,21 +371,27 @@ static QTextCodec* utf16le_codec{nullptr}; /* Jan 1, 2000 00:00:00 */ const time_t base_time_secs = 946706400; -struct lowranceusr4_fsdata { - format_specific_data fs; - uint uid_unit; - uint uid_unit2; - int uid_seq_low; - int uid_seq_high; - uint UUID1; - uint UUID2; - uint UUID3; - uint UUID4; - int flags; - int color; - const char *color_desc; - int icon_num; - float depth; +struct lowranceusr4_fsdata : FormatSpecificData { + lowranceusr4_fsdata() : FormatSpecificData(kFsLowranceusr4) {} + + lowranceusr4_fsdata* clone() const override + { + return new lowranceusr4_fsdata(*this); + } + + uint uid_unit{0}; + uint uid_unit2{0}; + int uid_seq_low{0}; + int uid_seq_high{0}; + uint UUID1{0}; + uint UUID2{0}; + uint UUID3{0}; + uint UUID4{0}; + int flags{0}; + int color{0}; + const char *color_desc{nullptr}; + int icon_num{0}; + float depth{0.0}; }; class Lowranceusr4Timestamp { @@ -396,38 +403,6 @@ class Lowranceusr4Timestamp { }; -/* fsdata manipulation functions */ -static void -lowranceusr4_free_fsdata(void* fsdata) -{ - xfree(fsdata); -} - -static void -lowranceusr4_copy_fsdata(lowranceusr4_fsdata** dest, lowranceusr4_fsdata* src) -{ - *dest = (lowranceusr4_fsdata*)xmalloc(sizeof(*src)); - ** dest = *src; - (*dest)->fs.next = nullptr; -} - -static -lowranceusr4_fsdata* -lowranceusr4_alloc_fsdata() -{ - auto* fsdata = (lowranceusr4_fsdata*) xcalloc(1, sizeof(lowranceusr4_fsdata)); - fsdata->fs.type = FS_LOWRANCEUSR4; - fsdata->fs.copy = (fs_copy) lowranceusr4_copy_fsdata; - fsdata->fs.destroy = lowranceusr4_free_fsdata; - - fsdata->uid_unit = 0; - fsdata->uid_seq_low = 0; - fsdata->uid_seq_high = 0; - - return fsdata; -} - - /* below couple of functions mostly borrowed from raymarine.c */ @@ -463,11 +438,9 @@ register_waypt(const Waypoint* wpt) static const Waypoint* lowranceusr4_find_waypt(uint uid_unit, int uid_seq_low, int uid_seq_high) { - lowranceusr4_fsdata* fs = nullptr; - // Iterate with waypt_disp_all? for (const Waypoint* waypointp : qAsConst(*global_waypoint_list)) { - fs = (lowranceusr4_fsdata*) fs_chain_find(waypointp->fs, FS_LOWRANCEUSR4); + const auto* fs = reinterpret_cast(waypointp->fs.FsChainFind(kFsLowranceusr4)); if (fs && fs->uid_unit == uid_unit && fs->uid_seq_low == uid_seq_low && @@ -486,11 +459,9 @@ lowranceusr4_find_waypt(uint uid_unit, int uid_seq_low, int uid_seq_high) static const Waypoint* lowranceusr4_find_global_waypt(uint id1, uint id2, uint id3, uint id4) { - lowranceusr4_fsdata* fs = nullptr; - // Iterate with waypt_disp_all? for (const Waypoint* waypointp : qAsConst(*global_waypoint_list)) { - fs = (lowranceusr4_fsdata*) fs_chain_find(waypointp->fs, FS_LOWRANCEUSR4); + const auto* fs = reinterpret_cast(waypointp->fs.FsChainFind(kFsLowranceusr4)); if (fs && fs->UUID1 == id1 && fs->UUID2 == id2 && @@ -921,8 +892,8 @@ lowranceusr4_parse_waypt(Waypoint* wpt_tmp) { int waypoint_version; - lowranceusr4_fsdata* fsdata = lowranceusr4_alloc_fsdata(); - fs_chain_add(&(wpt_tmp->fs), (format_specific_data*) fsdata); + auto* fsdata = new lowranceusr4_fsdata; + wpt_tmp->fs.FsChainAdd(fsdata); if (reading_version > 4) { /* USR 5 and 6 have four additional data values at the start of each Waypoint */ @@ -1171,8 +1142,8 @@ lowranceusr4_parse_route() int UUID3 = 0; int UUID4 = 0; - lowranceusr4_fsdata* fsdata = lowranceusr4_alloc_fsdata(); - fs_chain_add(&(rte_head->fs), (format_specific_data*) fsdata); + auto* fsdata = new lowranceusr4_fsdata; + rte_head->fs.FsChainAdd(fsdata); if (reading_version >= 5) { /* Routes have Universal IDs */ @@ -1423,8 +1394,8 @@ lowranceusr4_parse_trail(int* trail_num) int trail_color; int trail_flags; - lowranceusr4_fsdata* fsdata = lowranceusr4_alloc_fsdata(); - fs_chain_add(&(trk_head->fs), (format_specific_data*) fsdata); + auto* fsdata = new lowranceusr4_fsdata; + trk_head->fs.FsChainAdd(fsdata); /* UID unit number */ fsdata->uid_unit = gbfgetint32(file_in); @@ -1784,7 +1755,7 @@ lowranceusr_waypt_disp(const Waypoint* wpt) static void lowranceusr4_waypt_disp(const Waypoint* wpt) { - auto* fs = (lowranceusr4_fsdata*) fs_chain_find(wpt->fs, FS_LOWRANCEUSR4); + const auto* fs = reinterpret_cast(wpt->fs.FsChainFind(kFsLowranceusr4)); /* UID unit number */ if (opt_serialnum_i > 0) { @@ -2030,7 +2001,7 @@ lowranceusr4_route_hdr(const route_head* rte) route_uid, qPrintable(rte->rte_name), rte->rte_waypt_ct); } - auto* fs = (lowranceusr4_fsdata*) fs_chain_find(rte->fs, FS_LOWRANCEUSR4); + const auto* fs = reinterpret_cast(rte->fs.FsChainFind(kFsLowranceusr4)); /* UID unit number */ if (opt_serialnum_i > 0) { @@ -2061,7 +2032,7 @@ lowranceusr4_route_leg_disp(const Waypoint* wpt) for (int i = 0; i < waypt_table->size(); i++) { const Waypoint* cmp = waypt_table->at(i); if (cmp->shortname == wpt->shortname) { - auto* fs = (lowranceusr4_fsdata*) fs_chain_find(cmp->fs, FS_LOWRANCEUSR4); + const auto* fs = reinterpret_cast(cmp->fs.FsChainFind(kFsLowranceusr4)); if (opt_serialnum_i > 0) { gbfputint32(opt_serialnum_i, file_out); // use option serial number if specified diff --git a/make-an1sym.pl b/make-an1sym.pl index 6f2b7f0bd..16d08f52a 100755 --- a/make-an1sym.pl +++ b/make-an1sym.pl @@ -214,7 +214,7 @@ sub DoImage { sub print_header { print <<'END'; -/* +/* @@ -257,7 +257,7 @@ print <<'END'; /* Read DeLorme drawing files (.an1) - supplemental (included by an1.c) - + Copyright (C) 2005 Ron Parker and Robert Lipe. This program is free software; you can redistribute it and/or modify @@ -277,8 +277,8 @@ print <<'END'; */ static struct defguid { - guid_t guid; - const char *name; + guid_t guid; + const char* name; } default_guids[] = { END } @@ -287,28 +287,29 @@ sub print_footer { print <<'END'; }; -static int FindIconByName( const char *name, guid_t *guid ) { - unsigned int i = 0; - for ( i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); i++ ) - { - if ( !case_ignore_strcmp(name, default_guids[i].name)) { - memcpy( guid, &(default_guids[i].guid), sizeof(guid_t)); - return 1; - } - } - return 0; +static int FindIconByName(const char* name, guid_t* guid) +{ + for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); ++i) { + if (!case_ignore_strcmp(name, default_guids[i].name)) { + *guid = default_guids[i].guid; + return 1; + } + } + return 0; } -static int FindIconByGuid( guid_t *guid, char **name ) { - unsigned int i = 0; - for ( i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); i++ ) - { - if ( !memcmp(guid, &default_guids[i].guid, sizeof(guid_t))) { - *name = default_guids[i].name; - return 1; - } - } - return 0; +static int FindIconByGuid(const guid_t* guid, const char** name) +{ + for (unsigned int i = 0; i < (sizeof(default_guids)/sizeof(struct defguid)); ++i) { + /* don't compare any structure padding */ + if ((guid->l == default_guids[i].guid.l) && + memcmp(guid->s, default_guids[i].guid.s, sizeof(guid->s)) && + memcmp(guid->c, default_guids[i].guid.c, sizeof(guid->c))) { + *name = default_guids[i].name; + return 1; + } + } + return 0; } END } diff --git a/ozi.cc b/ozi.cc index d6221406b..87f7e036d 100644 --- a/ozi.cc +++ b/ozi.cc @@ -49,11 +49,13 @@ #include // for QString #include // for QStringList #include // for QTextStream, operator<<, qSetRealNumberPrecision, QTextStream::FixedNotation +#include // for QVector #include // for CaseInsensitive #include // for qPrintable #include "defs.h" #include "csv_util.h" // for csv_stringclean +#include "formspec.h" // for FsChainAdd, FsChainFind, kFsOzi, FormatSpecificData #include "jeeps/gpsmath.h" // for GPS_Math_Known_Datum_To_WGS84_M #include "src/core/datetime.h" // for DateTime #include "src/core/textstream.h" // for TextStream @@ -63,10 +65,16 @@ #define BADCHARS ",\r\n" #define DAYS_SINCE_1990 25569 -struct ozi_fsdata { - format_specific_data fs; - int fgcolor; - int bgcolor; +struct ozi_fsdata : FormatSpecificData { + ozi_fsdata() : FormatSpecificData(kFsOzi) {} + + ozi_fsdata* clone() const override + { + return new ozi_fsdata(*this); + } + + int fgcolor{0}; + int bgcolor{65535}; }; static gpsbabel::TextStream* stream = nullptr; @@ -169,29 +177,11 @@ ozi_close_io() stream = nullptr; } -static void -ozi_copy_fsdata(ozi_fsdata** dest, ozi_fsdata* src) -{ - /* No strings to mess with. Straight forward copy. */ - *dest = (ozi_fsdata*)xmalloc(sizeof(*src)); - ** dest = *src; - (*dest)->fs.next = nullptr; -} - -static void -ozi_free_fsdata(void* fsdata) -{ - xfree(fsdata); -} - static ozi_fsdata* ozi_alloc_fsdata() { - auto* fsdata = (ozi_fsdata*) xcalloc(1, sizeof(ozi_fsdata)); - fsdata->fs.type = FS_OZI; - fsdata->fs.copy = (fs_copy) ozi_copy_fsdata; - fsdata->fs.destroy = ozi_free_fsdata; + auto* fsdata = new ozi_fsdata; /* Provide defaults via command line defaults */ fsdata->fgcolor = color_to_bbggrr(wptfgcolor); @@ -844,8 +834,7 @@ data_read() case unknown_gpsdata: if (linecount > 4) { /* skipping over file header */ ozi_fsdata_used = true; - fs_chain_add(&(wpt_tmp->fs), - (format_specific_data*) fsdata); + wpt_tmp->fs.FsChainAdd(fsdata); ozi_convert_datum(wpt_tmp); waypt_add(wpt_tmp); } else { @@ -858,7 +847,7 @@ data_read() } if (!ozi_fsdata_used) { - fs_chain_destroy((format_specific_data*) fsdata); + delete fsdata; } } else { @@ -878,7 +867,7 @@ ozi_waypt_pr(const Waypoint* wpt) int faked_fsdata = 0; int icon = 0; - auto* fs = (ozi_fsdata*) fs_chain_find(wpt->fs, FS_OZI); + const auto* fs = reinterpret_cast(wpt->fs.FsChainFind(kFsOzi)); if (!fs) { fs = ozi_alloc_fsdata(); diff --git a/random.cc b/random.cc index 0105e12be..175d7be09 100644 --- a/random.cc +++ b/random.cc @@ -139,7 +139,7 @@ random_generate_wpt(int i, const QDateTime& time, const Waypoint* prev) { auto wpt = new Waypoint; garmin_fs_t* gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); do { wpt->shortname = rand_str(8, "Wpt_%s"); diff --git a/route.cc b/route.cc index 7fbfa0900..3070ea026 100644 --- a/route.cc +++ b/route.cc @@ -371,7 +371,6 @@ computed_trkdata track_recompute(const route_head* trk) route_head::route_head() : rte_num(0), rte_waypt_ct(0), - fs(nullptr), // line_color(), line_width(-1), session(curr_session()) @@ -381,9 +380,7 @@ route_head::route_head() : route_head::~route_head() { waypoint_list.flush(); - if (fs) { - fs_chain_destroy(fs); - } + fs.FsChainDestroy(); } int RouteList::waypt_count() const @@ -483,7 +480,7 @@ RouteList::copy(RouteList** dst) const rte_new->rte_urls = rte_old->rte_urls; rte_new->rte_num = rte_old->rte_num; // rte_waypt_ct created below with add_wpt. - rte_new->fs = fs_chain_copy(rte_old->fs); + rte_new->fs = rte_old->fs.FsChainCopy(); rte_new->line_color = rte_old->line_color; rte_new->line_width = rte_old->line_width; rte_new->session = rte_old->session; diff --git a/src/core/xmltag.h b/src/core/xmltag.h index 4bdae190a..7563eba65 100644 --- a/src/core/xmltag.h +++ b/src/core/xmltag.h @@ -40,11 +40,21 @@ xml_tag* xml_findfirst(xml_tag* root, const QString& tagname); xml_tag* xml_findnext(xml_tag* root, xml_tag* cur, const QString& tagname); QString xml_attribute(const QXmlStreamAttributes& attributes, const QString& attrname); -struct fs_xml { - format_specific_data fs; +struct fs_xml : FormatSpecificData { + explicit fs_xml(FsType type) : FormatSpecificData(type) {} +private: + fs_xml(const fs_xml&) = default; +public: + fs_xml& operator=(const fs_xml&) = delete; + fs_xml(fs_xml&&) = delete; + fs_xml& operator=(fs_xml&&) = delete; + ~fs_xml() override; + + fs_xml* clone() const override; + xml_tag* tag{nullptr}; }; -fs_xml* fs_xml_alloc(long type); +fs_xml* fs_xml_alloc(FsType type); #endif // SRC_CORE_XMLTAG_H diff --git a/text.cc b/text.cc index 3b6b13027..bc1aa866a 100644 --- a/text.cc +++ b/text.cc @@ -27,6 +27,7 @@ #include // for CaseInsensitive #include "defs.h" +#include "formspec.h" // for FsChainFind, kFsGpx #include "gbfile.h" // for gbfprintf, gbfputs, gbfclose, gbfopen, gbfile #include "jeeps/gpsmath.h" // for GPS_Math_WGS84_To_UTM_EN #include "src/core/datetime.h" // for DateTime @@ -172,69 +173,67 @@ text_disp(const Waypoint* wpt) gbfputs("\n", file_out); } - fs_xml* fs_gpx = nullptr; if (includelogs) { - fs_gpx = (fs_xml*)fs_chain_find(wpt->fs, FS_GPX); - } + const auto* fs_gpx = reinterpret_cast(wpt->fs.FsChainFind(kFsGpx)); + if (fs_gpx && fs_gpx->tag) { + xml_tag* root = fs_gpx->tag; + xml_tag* curlog = xml_findfirst(root, "groundspeak:log"); + while (curlog) { + time_t logtime = 0; + gbfprintf(file_out, "\n"); + + xml_tag* logpart = xml_findfirst(curlog, "groundspeak:type"); + if (logpart) { + gbfputs(logpart->cdata, file_out); + gbfputs(" by ", file_out); + } - if (fs_gpx && fs_gpx->tag) { - xml_tag* root = fs_gpx->tag; - xml_tag* curlog = xml_findfirst(root, "groundspeak:log"); - while (curlog) { - time_t logtime = 0; - gbfprintf(file_out, "\n"); - - xml_tag* logpart = xml_findfirst(curlog, "groundspeak:type"); - if (logpart) { - gbfputs(logpart->cdata, file_out); - gbfputs(" by ", file_out); - } + logpart = xml_findfirst(curlog, "groundspeak:finder"); + if (logpart) { + gbfputs(logpart->cdata, file_out); + gbfputs(" on ", file_out); + } - logpart = xml_findfirst(curlog, "groundspeak:finder"); - if (logpart) { - gbfputs(logpart->cdata, file_out); - gbfputs(" on ", file_out); - } + logpart = xml_findfirst(curlog, "groundspeak:date"); + if (logpart) { + logtime = xml_parse_time(logpart->cdata).toTime_t(); + struct tm* logtm = localtime(&logtime); + if (logtm) { + gbfprintf(file_out, + "%4.4d-%2.2d-%2.2d\n", + logtm->tm_year+1900, + logtm->tm_mon+1, + logtm->tm_mday); + } + } - logpart = xml_findfirst(curlog, "groundspeak:date"); - if (logpart) { - logtime = xml_parse_time(logpart->cdata).toTime_t(); - struct tm* logtm = localtime(&logtime); - if (logtm) { - gbfprintf(file_out, - "%4.4d-%2.2d-%2.2d\n", - logtm->tm_year+1900, - logtm->tm_mon+1, - logtm->tm_mday); + logpart = xml_findfirst(curlog, "groundspeak:log_wpt"); + if (logpart) { + double lat = xml_attribute(logpart->attributes, "lat").toDouble(); + double lon = xml_attribute(logpart->attributes, "lon").toDouble(); + char* coordstr = pretty_deg_format(lat, lon, degformat[2], " ", 0); + gbfprintf(file_out, "%s\n", coordstr); + xfree(coordstr); } - } - logpart = xml_findfirst(curlog, "groundspeak:log_wpt"); - if (logpart) { - double lat = xml_attribute(logpart->attributes, "lat").toDouble(); - double lon = xml_attribute(logpart->attributes, "lon").toDouble(); - char* coordstr = pretty_deg_format(lat, lon, degformat[2], " ", 0); - gbfprintf(file_out, "%s\n", coordstr); - xfree(coordstr); - } + logpart = xml_findfirst(curlog, "groundspeak:text"); + if (logpart) { + QString encstr = xml_attribute(logpart->attributes, "encoded"); + bool encoded = !encstr.startsWith('F', Qt::CaseInsensitive); - logpart = xml_findfirst(curlog, "groundspeak:text"); - if (logpart) { - QString encstr = xml_attribute(logpart->attributes, "encoded"); - bool encoded = !encstr.startsWith('F', Qt::CaseInsensitive); + QString s; + if (txt_encrypt && encoded) { + s = rot13(logpart->cdata); + } else { + s = logpart->cdata; + } - QString s; - if (txt_encrypt && encoded) { - s = rot13(logpart->cdata); - } else { - s = logpart->cdata; + gbfputs(s, file_out); } - gbfputs(s, file_out); + gbfprintf(file_out, "\n"); + curlog = xml_findnext(root, curlog, "groundspeak:log"); } - - gbfprintf(file_out, "\n"); - curlog = xml_findnext(root, curlog, "groundspeak:log"); } } if (! suppresssep) { diff --git a/unicsv.cc b/unicsv.cc index 63a966e25..7c4d3fe22 100644 --- a/unicsv.cc +++ b/unicsv.cc @@ -993,7 +993,7 @@ unicsv_parse_one_line(const QString& ibuf) gmsd = garmin_fs_t::find(wpt); if (! gmsd) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); } switch (unicsv_fields_tab[column]) { case fld_garmin_city: diff --git a/waypt.cc b/waypt.cc index 65e9c0a93..e7e942b86 100644 --- a/waypt.cc +++ b/waypt.cc @@ -32,7 +32,7 @@ #include // for qPrintable #include "defs.h" -#include "garmin_fs.h" // for garmin_ilink_t, garmin_fs_t, GMSD_FIND, garmin_fs_p +#include "garmin_fs.h" // for garmin_ilink_t, garmin_fs_t, GMSD_FIND #include "grtcirc.h" // for RAD, gcdist, heading_true_degrees, radtometers #include "session.h" // for curr_session, session_t #include "src/core/datetime.h" // for DateTime @@ -251,7 +251,7 @@ double waypt_distance_ex(const Waypoint* A, const Waypoint* B) { double res = 0; - garmin_fs_p gmsd; + garmin_fs_t* gmsd; if ((A == nullptr) || (B == nullptr)) { return 0; @@ -404,7 +404,6 @@ Waypoint::Waypoint() : temperature(0), odometer_distance(0), gc_data(&Waypoint::empty_gc_data), - fs(nullptr), session(curr_session()), extra_data(nullptr) { @@ -415,7 +414,7 @@ Waypoint::~Waypoint() if (gc_data != &Waypoint::empty_gc_data) { delete gc_data; } - fs_chain_destroy(fs); + fs.FsChainDestroy(); } Waypoint::Waypoint(const Waypoint& other) : @@ -446,7 +445,6 @@ Waypoint::Waypoint(const Waypoint& other) : temperature(other.temperature), odometer_distance(other.odometer_distance), gc_data(other.gc_data), - fs(other.fs), session(other.session), extra_data(other.extra_data) { @@ -456,7 +454,7 @@ Waypoint::Waypoint(const Waypoint& other) : } // deep copy fs chain data. - fs = fs_chain_copy(other.fs); + fs = other.fs.FsChainCopy(); // note: session is not deep copied. // note: extra_data is not deep copied. @@ -470,7 +468,7 @@ Waypoint& Waypoint::operator=(const Waypoint& rhs) if (gc_data != &Waypoint::empty_gc_data) { delete gc_data; } - fs_chain_destroy(fs); + fs.FsChainDestroy(); // allocate and copy latitude = rhs.latitude; @@ -500,7 +498,6 @@ Waypoint& Waypoint::operator=(const Waypoint& rhs) temperature = rhs.temperature; odometer_distance = rhs.odometer_distance; gc_data = rhs.gc_data; - fs = rhs.fs; session = rhs.session; extra_data = rhs.extra_data; // deep copy geocache data unless it is the special static empty_gc_data. @@ -509,7 +506,7 @@ Waypoint& Waypoint::operator=(const Waypoint& rhs) } // deep copy fs chain data. - fs = fs_chain_copy(rhs.fs); + fs = rhs.fs.FsChainCopy(); // note: session is not deep copied. // note: extra_data is not deep copied. diff --git a/xcsv.cc b/xcsv.cc index 8a0725bd2..61ce7bc41 100644 --- a/xcsv.cc +++ b/xcsv.cc @@ -387,7 +387,7 @@ XcsvFormat::gmsd_init(Waypoint* wpt) garmin_fs_t* gmsd = garmin_fs_t::find(wpt); if (gmsd == nullptr) { gmsd = garmin_fs_alloc(-1); - fs_chain_add(&wpt->fs, (format_specific_data*) gmsd); + wpt->fs.FsChainAdd(gmsd); } return gmsd; } diff --git a/xmltag.cc b/xmltag.cc index 1aa7f6c84..da2f71d9b 100644 --- a/xmltag.cc +++ b/xmltag.cc @@ -60,36 +60,20 @@ copy_xml_tag(xml_tag** copy, xml_tag* src, xml_tag* parent) copy_xml_tag(&(res->child), src->child, res); } -static void -fs_xml_destroy(void* fs) +fs_xml::~fs_xml() { - auto* xml = (fs_xml*)fs; - if (xml) { - free_xml_tag(xml->tag); - } - delete xml; + free_xml_tag(tag); } -static void -fs_xml_copy(void** copy, void* source) +fs_xml* fs_xml::clone() const { - auto* src = (fs_xml*)source; - if (!source) { - *copy = nullptr; - return; - } - auto* res = new fs_xml; - *copy = res; - - res->fs = src->fs; - copy_xml_tag(&(res->tag), src->tag, nullptr); + auto* copy = new fs_xml(*this); + copy_xml_tag(&(copy->tag), tag, nullptr); + return copy; } -fs_xml* fs_xml_alloc(long type) +fs_xml* fs_xml_alloc(FsType type) { - auto* result = new fs_xml; - result->fs.type = type; - result->fs.copy = fs_xml_copy; - result->fs.destroy = fs_xml_destroy; + auto* result = new fs_xml(type); return result; } -- 2.30.2